//
//  WKScriptMessageHandler.m
//  XianjinXia
//
//  Created by Xianjinkd on 2017/8/2.
//  Copyright © 2017年 lxw. All rights reserved.
//

#import "WKScriptMessageHandler.h"

@implementation WKScriptMessageHandler

-(instancetype)initWithDelegate:(id<WKScriptMessageHandler>)delegate {
    if (self = [super init]) {
        _delegate = delegate;
    }
    
    return self;
}


+(instancetype)scriptWithDelegate:(id<WKScriptMessageHandler>)delegate {
    return [[WKScriptMessageHandler alloc] initWithDelegate:delegate];
}


#pragma mark - <WKScriptMessageHandler>
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    [self.delegate userContentController:userContentController didReceiveScriptMessage:message];
}


@end
